/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Chapter2;

import java.util.Calendar.*;
import java.util.Calendar;

/**
 *
 * @author David
 */
public class GregorianCalendar1 {

    int day;
    Calendar cal = Calendar.getInstance();
    int year;

    public GregorianCalendar1(int year, Calendar month, int day )
    {
       this.day = day;
       cal.add(month.MONTH, day);
       this.year = year;
       
    }
    public void add(Calendar d, int num)
    {
        cal.add(d.DATE, num);
        day = num;
    }
    
    public void getTime(){
        System.out.println(cal.getTime() + " " + cal.YEAR);
    }
    public static void main(String [] args)
    {
        Calendar c = Calendar.getInstance();
        c.add(Calendar.MONTH, 0);
        GregorianCalendar1 gc1 = new GregorianCalendar1(1979, c, 21);
        gc1.add(c, 1000000000);
        gc1.getTime();
    }

}
